package com.springmvc.web.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.springmvc.web.dao.IUserDao;
import com.springmvc.web.entity.User;

import com.springmvc.web.service.IUserService;

@Repository
public class UserServiceImpl implements IUserService{
			
		@Autowired
		private IUserDao userDao;
				
			@Override
			public void addUser(User user) {
				
				this.userDao.addUser(user);
			}
			
			@Override
			public void delUser(Integer id) {
				
				 this.userDao.delUser(id);
			}
			
			@Override
			public User getUser(Integer id) {
				
				return this.userDao.getUser(id);
			}
		    
			@Override
			public List<User> getUserByName(int rows,int startrow,String username) {
				
			    return this.userDao.getUserByName(rows,startrow,username);
			}
			
			@Override
			public void updateUser(User user) {
				
			    this.userDao.updateUser(user);
			}
		
			@Override
			public List<User> getAllUser() {
					
				return this.userDao.getAllUser();
			}
	 
			@Override
			public int getTotal() {
			
				return this.userDao.getTotal();
			}

			@Override
			public List<User> selectUserByPager(int rows,int startrow,Integer id, String username) {
						
				return this.userDao.selectUserByPager(rows , startrow, id, username);
			}

}
